package com.gisocn.onemap.ui.activity;

import android.app.ProgressDialog;
import android.content.Intent;
import android.content.SharedPreferences;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.media.MediaScannerConnection;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Base64;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Toast;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.amap.api.services.geocoder.GeocodeSearch;
import com.esri.core.geometry.GeometryEngine;
import com.esri.core.geometry.Point;
import com.esri.core.geometry.SpatialReference;
import com.gisocn.onemap.base.BaseActivity;
import com.gisocn.onemap.base.Constant;
import com.gisocn.onemap.model.AppConfig;
import com.gisocn.onemap.model.AppVersion;
import com.gisocn.onemap.model.CheckDeviceModel;
import com.gisocn.onemap.model.FingerPassWord;
import com.gisocn.onemap.model.GetPostRequest;
import com.gisocn.onemap.model.LoginModel;
import com.gisocn.onemap.model.RegisterModel;
import com.gisocn.onemap.presenter.LoginPresenter;
import com.gisocn.onemap.sgzx.R;
import com.gisocn.onemap.utils.AppVersionManager;
import com.gisocn.onemap.utils.L;
import com.gisocn.onemap.utils.PackageUtils;
import com.gisocn.onemap.utils.SpUtils;
import com.gisocn.onemap.view.LoginView;
import com.github.mikephil.charting.utils.Utils;
import com.google.gson.Gson;
import com.sangfor.bugreport.logger.Log;
import com.sangfor.ssl.BaseMessage;
import com.sangfor.ssl.IConstants;
import com.sangfor.ssl.LoginResultListener;
import com.sangfor.ssl.OnStatusChangedListener;
import com.sangfor.ssl.SFException;
import com.sangfor.ssl.SangforAuthManager;
import com.sangfor.ssl.StatusChangedReason;
import com.sangfor.ssl.common.ErrorCode;
import com.sangfor.ssl.service.utils.IGeneral;
import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import java.util.HashMap;
import javax.crypto.Cipher;

/* loaded from: classes2.dex */
public class LoginActivity extends BaseActivity<LoginPresenter> implements LoginView, LoginResultListener {
    public static final String ECB_PKCS1_PADDING = "RSA/ECB/PKCS1Padding";
    private static final String TAG = "LoginActivity";
    @BindView(R.id.et_organization)
    EditText etOrganization;
    @BindView(R.id.et_uese_count)
    EditText etUeseCount;
    @BindView(R.id.et_uese_name)
    EditText etUeseName;
    @BindView(R.id.et_uese_phone)
    EditText etUesePhone;
    @BindView(R.id.et_uese_pwd)
    EditText etUesePwd;
    private LocationListener gpsLocationListener;
    @BindView(R.id.ll_login)
    LinearLayout llLogin;
    @BindView(R.id.ll_register)
    RelativeLayout llRegister;
    private LocationManager locationManager;
    @BindView(R.id.login_btn)
    ImageView loginBtn;
    @BindView(R.id.login_editText_count)
    EditText loginEditTextCount;
    @BindView(R.id.login_editText_paw)
    EditText loginEditTextPaw;
    private LocationListener networkLocationListener;
    @BindView(R.id.rl_bg)
    RelativeLayout rlBg;
    boolean isregister = true;
    private String userId = "";
    private String rsaEncode = "";
    private FingerPassWord fingerPassWord = null;
    private String mUserName = "gtj";
    private String mUserPassword = "GTJappjc@!@2021";
    private String mVpnAddress = "https://221.1.80.130:442";
    private URL mVpnAddressURL = null;
    private IConstants.VPNMode mVpnMode = IConstants.VPNMode.L3VPN;
    private SangforAuthManager mSFManager = null;
    boolean vpnNet = false;
    private int mAuthMethod = 1;
    private ProgressDialog mProgressDialog = null;
    double longitude = Utils.DOUBLE_EPSILON;
    double latitude = Utils.DOUBLE_EPSILON;
    String longitudeStr = "";
    String latitudeStr = "";
    boolean toSGLocation = false;

    @Override // com.gisocn.onemap.view.LoginView
    public void getAppVersionFail(String str) {
    }

    void test() {
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void updaeFinish() {
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.gisocn.onemap.base.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        init();
    }

    /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARN: Code restructure failed: missing block: B:34:0x008a, code lost:
        if (r0.equals("sg") == false) goto L3;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    void init() {
        /*
            Method dump skipped, instructions count: 286
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.gisocn.onemap.ui.activity.LoginActivity.init():void");
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.gisocn.onemap.base.BaseActivity
    public LoginPresenter createPresenter() {
        return new LoginPresenter(this, this);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onStart() {
        super.onStart();
        initPermission();
    }

    @Override // com.sangfor.ssl.LoginResultListener
    public void onLoginFailed(ErrorCode errorCode, String str) {
        cancelWaitingProgressDialog();
        if (!TextUtils.isEmpty(str)) {
            Toast.makeText(this, getString(R.string.str_login_failed) + str, 0).show();
            return;
        }
        Toast.makeText(this, (int) R.string.str_login_failed, 0).show();
    }

    @Override // com.sangfor.ssl.LoginResultListener
    public void onLoginProcess(int i, BaseMessage baseMessage) {
        cancelWaitingProgressDialog();
    }

    @Override // com.sangfor.ssl.LoginResultListener
    public void onLoginSuccess() {
        cancelWaitingProgressDialog();
        this.vpnNet = true;
        showToast("VPN连接成功，请登录。");
        HashMap hashMap = new HashMap();
        hashMap.put("DeviceKey", getDeviceId());
        ((LoginPresenter) this.presenter).checkDevice(hashMap);
        ((LoginPresenter) this.presenter).getVersion("https://sgwsbjxt.shouguang.gov.cn/SG.MobileUpdate/WebService.asmx?wsdl");
        SharedPreferences sharedPreferences = getSharedPreferences(getPackageName(), 0);
        String string = sharedPreferences.getString("username", "");
        String string2 = sharedPreferences.getString("password", "");
        this.loginEditTextCount.setText(string);
        this.loginEditTextPaw.setText(string2);
    }

    protected void cancelWaitingProgressDialog() {
        ProgressDialog progressDialog = this.mProgressDialog;
        if (progressDialog == null || !progressDialog.isShowing()) {
            return;
        }
        this.mProgressDialog.dismiss();
        this.mProgressDialog = null;
    }

    protected void createWaitingProgressDialog() {
        ProgressDialog progressDialog = this.mProgressDialog;
        if (progressDialog == null || !progressDialog.isShowing()) {
            ProgressDialog progressDialog2 = new ProgressDialog(this);
            this.mProgressDialog = progressDialog2;
            progressDialog2.setProgressStyle(0);
            this.mProgressDialog.setTitle("");
            this.mProgressDialog.setMessage(getString(R.string.str_waiting));
            this.mProgressDialog.setCancelable(false);
            this.mProgressDialog.show();
        }
    }

    private void startVPNInitAndLogin() {
        URL url;
        initLoginParms();
        createWaitingProgressDialog();
        try {
            url = new URL(this.mVpnAddress);
            this.mVpnAddressURL = url;
        } catch (Exception e) {
            Toast.makeText(this, (int) R.string.str_url_error, 1).show();
            Log.error(TAG, "", e);
        }
        if (TextUtils.isEmpty(url.getHost())) {
            throw new IllegalArgumentException();
        }
        try {
            addStatusChangedListener();
            if (this.mAuthMethod == 1) {
                this.mSFManager.startPasswordAuthLogin(getApplication(), this, this.mVpnMode, this.mVpnAddressURL, this.mUserName, this.mUserPassword);
            } else {
                Toast.makeText(this, (int) R.string.str_auth_type_error, 0).show();
            }
        } catch (SFException e2) {
            cancelWaitingProgressDialog();
            Log.info(TAG, "SFException:%s", e2);
        }
    }

    private void initLoginParms() {
        SangforAuthManager sangforAuthManager = SangforAuthManager.getInstance();
        this.mSFManager = sangforAuthManager;
        try {
            sangforAuthManager.setLoginResultListener(this);
        } catch (SFException e) {
            Log.info(TAG, "SFException:%s", e);
        }
        this.mSFManager.setAuthConnectTimeOut(8);
    }

    private void addStatusChangedListener() throws SFException {
        this.mSFManager.addStatusChangedListener(new OnStatusChangedListener() { // from class: com.gisocn.onemap.ui.activity.LoginActivity.1
            @Override // com.sangfor.ssl.OnStatusChangedListener
            public void onStatusCallback(IConstants.VPNStatus vPNStatus, StatusChangedReason statusChangedReason) {
                int i = AnonymousClass5.$SwitchMap$com$sangfor$ssl$IConstants$VPNStatus[vPNStatus.ordinal()];
                if (i == 1) {
                    LoginActivity.this.getString(R.string.str_vpn_online);
                } else if (i == 2) {
                    LoginActivity.this.getString(R.string.str_vpn_offline);
                } else if (i != 3) {
                } else {
                    LoginActivity.this.getString(R.string.str_vpn_reconnected);
                }
            }
        });
    }

    /* renamed from: com.gisocn.onemap.ui.activity.LoginActivity$5  reason: invalid class name */
    /* loaded from: classes2.dex */
    static /* synthetic */ class AnonymousClass5 {
        static final /* synthetic */ int[] $SwitchMap$com$sangfor$ssl$IConstants$VPNStatus;

        static {
            int[] iArr = new int[IConstants.VPNStatus.values().length];
            $SwitchMap$com$sangfor$ssl$IConstants$VPNStatus = iArr;
            try {
                iArr[IConstants.VPNStatus.VPNONLINE.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$com$sangfor$ssl$IConstants$VPNStatus[IConstants.VPNStatus.VPNOFFLINE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$com$sangfor$ssl$IConstants$VPNStatus[IConstants.VPNStatus.VPNRECONNECTED.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
        }
    }

    private void initPermission() {
        String[] strArr = {"android.permission.ACCESS_FINE_LOCATION", "android.permission.INTERNET", "android.permission.ACCESS_WIFI_STATE", "android.permission.ACCESS_NETWORK_STATE", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.WRITE_SETTINGS"};
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < 6; i++) {
            String str = strArr[i];
            if (ActivityCompat.checkSelfPermission(this, str) != 0) {
                arrayList.add(str);
            }
        }
        if (arrayList.size() > 0) {
            ActivityCompat.requestPermissions(this, (String[]) arrayList.toArray(new String[arrayList.size()]), 101);
        }
        initCreateFile();
        initLocation();
    }

    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity, androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        if (iArr.length != 0 && i == 101 && iArr[0] == 0) {
            initCreateFile();
            if (ContextCompat.checkSelfPermission(this, "android.permission.ACCESS_FINE_LOCATION") == 0) {
                initLocation();
            }
        }
        startVPNInitAndLogin();
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void showFailMsg(String str) {
        showToast(str);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void userLoginSuccess(LoginModel loginModel) {
        android.util.Log.e("userLoginSuccess", new Gson().toJson(loginModel));
        SharedPreferences.Editor edit = getSharedPreferences(getPackageName(), 0).edit();
        edit.putString("username", getStr(this.loginEditTextCount));
        edit.putString("password", getStr(this.loginEditTextPaw));
        edit.commit();
        String userId = loginModel.getData().getUserId();
        this.userId = userId;
        SpUtils.put(this, "userId", userId);
        SpUtils.put(this, "deviceId", getDeviceId());
        if (Constant.IS_TRIAL) {
            return;
        }
        ((LoginPresenter) this.presenter).getAppConfigData(getDeviceId(), this.userId);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void userLoginFail(String str) {
        dismissProgressDialog();
        showToast(str);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void checkDeviceSuccess(CheckDeviceModel checkDeviceModel) {
        android.util.Log.e("checkDeviceSuccess", new Gson().toJson(checkDeviceModel));
        this.isregister = true;
        if (!isNull(SpUtils.get(this, "fingerPassWord", "").toString())) {
            this.fingerPassWord = (FingerPassWord) new Gson().fromJson(SpUtils.get(this, "fingerPassWord", "").toString(), (Class<Object>) FingerPassWord.class);
        }
        FingerPassWord fingerPassWord = this.fingerPassWord;
        if (fingerPassWord == null || !fingerPassWord.isEnable() || !this.fingerPassWord.isPatternLock() || isNull(this.fingerPassWord.getPassWord())) {
            return;
        }
        Intent intent = new Intent(this, PatternLockActivity.class);
        intent.putExtra("isLogin", true);
        startActivityForResult(intent, 100);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void checkDeviceFail(String str) {
        android.util.Log.e("checkDeviceFail", str);
        this.llLogin.setVisibility(8);
        this.llRegister.setVisibility(0);
        this.isregister = false;
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void registerDeviceSuccess(RegisterModel registerModel) {
        android.util.Log.e("registerDeviceSuccess", new Gson().toJson(registerModel));
        this.isregister = true;
        this.loginBtn.setImageResource(R.mipmap.icon_login);
        showToast("设备注册成功");
        this.llLogin.setVisibility(0);
        this.llRegister.setVisibility(8);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void registerDeviceFail(String str) {
        showToast(str);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void getAppConfig(AppConfig appConfig) {
        dismissProgressDialog();
        Intent intent = new Intent(this, MainActivity.class);
        intent.putExtra("appConfig", new Gson().toJson(appConfig));
        startActivity(intent);
        finish();
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void getAppConfigFail(String str) {
        dismissProgressDialog();
        showToast(str);
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void getAppVersionSuccess(AppVersion appVersion) {
        if (Integer.parseInt(appVersion.getVersion()) > PackageUtils.getVersionCode(this)) {
            dismissProgressDialog();
            AppVersionManager appVersionManager = new AppVersionManager(this);
            appVersionManager.upDateAppVersion(appVersion.getInstallUrl(), appVersion.getVersionShort());
            appVersionManager.updaResult(new AppVersionManager.IUpdataResult() { // from class: com.gisocn.onemap.ui.activity.LoginActivity.2
                @Override // com.gisocn.onemap.utils.AppVersionManager.IUpdataResult
                public void updataResult() {
                    android.util.Log.d("取消更新:", "取消更新:");
                }
            });
        }
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void getXMLAppConfigSuccess() {
        ((LoginPresenter) this.presenter).getAppConfigData();
    }

    @Override // com.gisocn.onemap.view.LoginView
    public void getXMLAppConfigFail(String str) {
        showToast(str);
        ((LoginPresenter) this.presenter).getAppConfigData();
    }

    void register() {
        GetPostRequest.Data data = new GetPostRequest.Data();
        data.setDeviceKey(getDeviceId());
        data.setName(getStr(this.etUeseCount));
        data.setRemark("用户名:" + getStr(this.etUeseCount) + "\n密码:" + getStr(this.etUesePwd) + "\n手机号码:" + getStr(this.etUesePhone) + "\n姓名:" + getStr(this.etUeseName) + "\n单位名称:" + getStr(this.etOrganization) + "\n");
        GetPostRequest getPostRequest = new GetPostRequest();
        getPostRequest.setData(data);
        ((LoginPresenter) this.presenter).registerDevice(getPostRequest);
    }

    void getAppVersion() {
        HashMap hashMap = new HashMap();
        hashMap.put("api_token", Constant.API_TOKEN);
        hashMap.put("type", "android");
        ((LoginPresenter) this.presenter).getAppVersion(Constant.FIR_IM_VERSION_URL + getPackageName() + "?", hashMap);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onActivityResult(int i, int i2, Intent intent) {
        if (i == 1) {
            this.mSFManager.onActivityResult(i, i2);
        }
        super.onActivityResult(i, i2, intent);
        if (i == 100 && i2 == 200 && intent != null && intent.getBooleanExtra("result", false)) {
            HashMap hashMap = new HashMap();
            hashMap.put("DeviceKey", getDeviceId());
            hashMap.put("UserName", getStr(this.loginEditTextCount));
            hashMap.put("Pwd", getStr(this.loginEditTextPaw));
            hashMap.put("lng", this.longitudeStr);
            hashMap.put("lat", this.latitudeStr);
            ((LoginPresenter) this.presenter).doLogin(hashMap);
        }
    }

    @OnClick({R.id.login_btn, R.id.btn_register})
    public void onViewClicked(View view) {
        int id = view.getId();
        if (id != R.id.btn_register) {
            if (id != R.id.login_btn) {
                return;
            }
            showProgressDialog("登录中");
            HashMap hashMap = new HashMap();
            hashMap.put("DeviceKey", getDeviceId());
            hashMap.put("UserName", getStr(this.loginEditTextCount));
            String rsaEncode = rsaEncode(getStr(this.loginEditTextPaw));
            this.rsaEncode = rsaEncode;
            hashMap.put("Pwd", rsaEncode);
            hashMap.put("lng", this.longitudeStr);
            hashMap.put("lat", this.latitudeStr);
            ((LoginPresenter) this.presenter).doLogin(hashMap);
        } else if (!isNull(getStr(this.etUeseCount))) {
            if (!isNull(getStr(this.etUesePwd))) {
                if (!isNull(getStr(this.etUesePhone))) {
                    if (!isNull(getStr(this.etUeseName))) {
                        if (!isNull(getStr(this.etOrganization))) {
                            register();
                            return;
                        } else {
                            showToast("单位名称不能为空");
                            return;
                        }
                    }
                    showToast("用户姓名不能为空");
                    return;
                }
                showToast("手机号不能为空");
                return;
            }
            showToast("密码为空");
        } else {
            showToast("用户名不能为空");
        }
    }

    public static String rsaChcode(String str) {
        try {
            PrivateKey generatePrivate = KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(Base64.decode(Constant.APPCONFIG_PrKey_NAME, 0)));
            Cipher cipher = Cipher.getInstance(ECB_PKCS1_PADDING);
            cipher.init(2, generatePrivate);
            return Base64.encodeToString(cipher.doFinal(str.getBytes("UTF-8")), 0);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    public static String rsaEncode(String str) {
        try {
            byte[] decode = Base64.decode(Constant.APPCONFIG_PuKey_NAME, 0);
            Cipher cipher = Cipher.getInstance(ECB_PKCS1_PADDING);
            cipher.init(1, (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(decode)));
            return Base64.encodeToString(cipher.doFinal(str.getBytes("UTF-8")), 0);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }

    void initLocation() {
        this.locationManager = (LocationManager) getSystemService("location");
        this.gpsLocationListener = new LocationListener() { // from class: com.gisocn.onemap.ui.activity.LoginActivity.3
            @Override // android.location.LocationListener
            public void onProviderDisabled(String str) {
            }

            @Override // android.location.LocationListener
            public void onProviderEnabled(String str) {
            }

            @Override // android.location.LocationListener
            public void onStatusChanged(String str, int i, Bundle bundle) {
            }

            @Override // android.location.LocationListener
            public void onLocationChanged(Location location) {
                LoginActivity.this.longitude = location.getLongitude();
                LoginActivity.this.latitude = location.getLatitude();
                LoginActivity loginActivity = LoginActivity.this;
                loginActivity.toSGLocation(loginActivity.longitude, LoginActivity.this.latitude);
            }
        };
        this.networkLocationListener = new LocationListener() { // from class: com.gisocn.onemap.ui.activity.LoginActivity.4
            @Override // android.location.LocationListener
            public void onProviderDisabled(String str) {
            }

            @Override // android.location.LocationListener
            public void onProviderEnabled(String str) {
            }

            @Override // android.location.LocationListener
            public void onStatusChanged(String str, int i, Bundle bundle) {
            }

            @Override // android.location.LocationListener
            public void onLocationChanged(Location location) {
                LoginActivity.this.longitude = location.getLongitude();
                LoginActivity.this.latitude = location.getLatitude();
                LoginActivity loginActivity = LoginActivity.this;
                loginActivity.toSGLocation(loginActivity.longitude, LoginActivity.this.latitude);
            }
        };
        if (ActivityCompat.checkSelfPermission(this, "android.permission.ACCESS_FINE_LOCATION") != 0 && ActivityCompat.checkSelfPermission(this, "android.permission.ACCESS_COARSE_LOCATION") != 0) {
            ActivityCompat.requestPermissions(this, new String[]{"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"}, 1);
            return;
        }
        this.locationManager.requestLocationUpdates(GeocodeSearch.GPS, 1000L, 0.0f, this.gpsLocationListener);
        this.locationManager.requestLocationUpdates(IGeneral.LOG_TAG_NETWORK, 1000L, 0.0f, this.networkLocationListener);
    }

    void toSGLocation(double d, double d2) {
        if (this.toSGLocation) {
            return;
        }
        Point point = new Point(d, d2);
        android.util.Log.e("toSGLocation", "寿光坐标转化");
        Point point2 = (Point) GeometryEngine.project(point, SpatialReference.create(4326), SpatialReference.create(4528));
        android.util.Log.e("mapPoint", point2.getX() + "");
        android.util.Log.e("mapPoint", point2.getY() + "");
        BigDecimal bigDecimal = new BigDecimal(point2.getX() + "");
        BigDecimal bigDecimal2 = new BigDecimal(point2.getY() + "");
        L.e(bigDecimal.toPlainString() + "------------" + bigDecimal2.toPlainString());
        L.e(com.gisocn.onemap.utils.Utils.dealRateStr(bigDecimal.toPlainString(), 2) + "------------" + com.gisocn.onemap.utils.Utils.dealRateStr(bigDecimal2.toPlainString(), 2));
        this.longitudeStr = com.gisocn.onemap.utils.Utils.dealRateStr(bigDecimal.toPlainString(), 2);
        this.latitudeStr = com.gisocn.onemap.utils.Utils.dealRateStr(bigDecimal2.toPlainString(), 2);
        this.toSGLocation = true;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.gisocn.onemap.base.BaseActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, android.app.Activity
    public void onDestroy() {
        super.onDestroy();
        this.locationManager = null;
        this.gpsLocationListener = null;
        this.networkLocationListener = null;
    }

    void initCreateFile() {
        if (ActivityCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0) {
            File file = new File(Constant.SAVE_PATH);
            File file2 = new File(Constant.SAVE_PATH_TPK);
            File file3 = new File(Constant.SAVE_PATH_SHP);
            if (!file.exists()) {
                file.mkdir();
                MediaScannerConnection.scanFile(this, new String[]{file.getAbsolutePath()}, null, null);
            }
            if (!file2.exists()) {
                file2.mkdir();
                MediaScannerConnection.scanFile(this, new String[]{file2.getAbsolutePath()}, null, null);
            }
            if (file3.exists()) {
                return;
            }
            file3.mkdir();
            MediaScannerConnection.scanFile(this, new String[]{file3.getAbsolutePath()}, null, null);
        }
    }
}
